-- Your app starts here!
local sceneGame = dofile("game.lua")
local sceneInstructions = dofile("instructions.lua")


local buttonPlay = director:createSprite(director.displayCenterX, director.displayCenterY, "img/button.png")
buttonPlay.xAnchor=0.5; buttonPlay.yAnchor=0.5

buttonPlay.y = buttonPlay.y - buttonPlay.h/2

local buttonInstructions = director:createSprite(director.displayCenterX, director.displayCenterY, "img/button.png")
buttonInstructions.xAnchor=0.5; buttonInstructions.yAnchor=0.5

buttonInstructions.y = buttonInstructions.y + buttonInstructions.h/2

function buttonPlay:touch(event)
    if (event.phase == 'began') then
        director:moveToScene(sceneGame, {transitionType="slideInL", transitionTime=0.5})
	end
end
buttonPlay:addEventListener('touch', buttonPlay)

function buttonInstructions:touch(event)
    if (event.phase == 'began') then
        director:moveToScene(sceneInstructions, {transitionType="slideInL", transitionTime=0.5})
	end
end

buttonInstructions:addEventListener('touch', buttonInstructions)

director:moveToScene(sceneGame)